<template>

	<view class="">
		<scroll-view :show-scrollbar="false" class="margin-top" v-if="show">

			<common-nav-bar home category cart setting :title="'个人中心'" sticky />
			<my-header />
			<recommend ref="recommend" />
			<back-top v-show="isBottom" @click.native="backTop" />
		</scroll-view>

		<view class="background" v-else>

		</view>
	</view>


</template>
<script>
	import MyHeader from "./childCpn/MyHeader";
	import CommonNavBar from "components/common/NavBar/CommonNavBar";

	import Recommend from "components/common/Recommend/Recommend";

	import BackTop from "components/content/BackTop/BackTop";

	import {
		debounce
	} from "common/utils";

	export default {
		name: "My",
		data() {
			return {
				goodRecommend: null,
				RecommendLoad: "RecommendLoad",
				show: false,
				isBottom: false,
			};
		},
		components: {
			MyHeader,
			Recommend,
			BackTop,
			CommonNavBar,
		},
		onShow() {
			if (!uni.getStorageSync('token') && !this.isLogin) {
				uni.navigateTo({
					url: "/pages/user/Login"
				})
			} else {
				this.show = true;
			}


		},
		watch: {
			isLogin(newV) {
				this.show = uni.getStorageSync('token') && newV;
			},
		},
		onPageScroll(e) {
			this.over = e.scrollTop >= this.offsetTop;
			this.isBottom = this.pageHeight < e.scrollTop;
		},
	};
</script>
<style lang="scss" scoped>
	.Mine_Main {
		background-color: rgb(240, 240, 240);
		width: 100vw;
		overflow: hidden;
	}

	.background {
		height: 100vh;
		width: 100vw;
		background-color: white;
	}
</style>
